//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
        // to see how IntelliJ IDEA suggests fixing it.
        System.out.println("Hello and welcome!");

        Aggregate aggregate = new ConcreteAggregate();

        IIterator iterator = aggregate.createIterator();

        iterator.addObject("孙悟空");
        iterator.addObject("猪八戒");
        iterator.addObject("沙和尚");

        while (iterator.hasNext()){
            System.out.println(iterator.currentItme().toString());
            iterator.moveNext();
        }





    }
}